home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_apache2.idb / usr / freeware / apache2 / include / apr.h.z / apr.h
C/C++ Source or Header  |  2002-07-08  |  9KB  |  314 lines

  1. #ifndef APR_H
  2. #define APR_H
  3.  
  4. /**
  5.  * @file include/apr.h
  6.  * @brief APR APR Main Include
  7.  */
  8. /**
  9.  * @defgroup APR APR Routines
  10.  * @{
  11.  */
  12.  
  13. /* So that we can use inline on some critical functions, and use
  14.  * GNUC attributes (such as to get -Wall warnings for printf-like
  15.  * functions).  Only do this in gcc 2.7 or later ... it may work
  16.  * on earlier stuff, but why chance it.
  17.  *
  18.  * We've since discovered that the gcc shipped with NeXT systems
  19.  * as "cc" is completely broken.  It claims to be __GNUC__ and so
  20.  * on, but it doesn't implement half of the things that __GNUC__
  21.  * means.  In particular it's missing inline and the __attribute__
  22.  * stuff.  So we hack around it.  PR#1613. -djg
  23.  */
  24. #if !defined(__GNUC__) || __GNUC__ < 2 || \
  25.     (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
  26.     defined(NEXT)
  27. #define APR_INLINE
  28. #define __attribute__(__x)
  29. #define APR_HAS_INLINE        0
  30. #else
  31. #define APR_INLINE __inline__
  32. #define APR_HAS_INLINE        1
  33. #endif
  34.  
  35. #define APR_HAVE_ARPA_INET_H     1
  36. #define APR_HAVE_CONIO_H         0
  37. #define APR_HAVE_CRYPT_H         1
  38. #define APR_HAVE_CTYPE_H         1
  39. #define APR_HAVE_DIRENT_H        1
  40. #define APR_HAVE_ERRNO_H         1
  41. #define APR_HAVE_FCNTL_H         1
  42. #define APR_HAVE_IO_H            0
  43. #define APR_HAVE_LIMITS_H        1
  44. #define APR_HAVE_NETDB_H         1
  45. #define APR_HAVE_NETINET_IN_H    1
  46. #define APR_HAVE_NETINET_TCP_H   1
  47. #define APR_HAVE_PTHREAD_H       1
  48. #define APR_HAVE_SEMAPHORE_H     1
  49. #define APR_HAVE_SIGNAL_H        1
  50. #define APR_HAVE_STDARG_H        1
  51. #define APR_HAVE_STDINT_H        0
  52. #define APR_HAVE_STDIO_H         1
  53. #define APR_HAVE_STDLIB_H        1
  54. #define APR_HAVE_STRING_H        1
  55. #define APR_HAVE_STRINGS_H       1
  56. #define APR_HAVE_SYS_SENDFILE_H  0
  57. #define APR_HAVE_SYS_SIGNAL_H    1
  58. #define APR_HAVE_SYS_SOCKET_H    1
  59. #define APR_HAVE_SYS_SYSLIMITS_H 0
  60. #define APR_HAVE_SYS_TIME_H      1
  61. #define APR_HAVE_SYS_TYPES_H     1
  62. #define APR_HAVE_SYS_UIO_H       1
  63. #define APR_HAVE_SYS_UN_H        1
  64. #define APR_HAVE_SYS_WAIT_H      1
  65. #define APR_HAVE_TIME_H          1
  66. #define APR_HAVE_UNISTD_H        1
  67.  
  68. #define APR_HAVE_SHMEM_MMAP_TMP     1
  69. #define APR_HAVE_SHMEM_MMAP_SHM     1
  70. #define APR_HAVE_SHMEM_MMAP_ZERO    1
  71. #define APR_HAVE_SHMEM_SHMGET_ANON  1
  72. #define APR_HAVE_SHMEM_SHMGET       1
  73. #define APR_HAVE_SHMEM_MMAP_ANON    0
  74. #define APR_HAVE_SHMEM_BEOS         0
  75.  
  76. #define APR_USE_SHMEM_MMAP_TMP     0
  77. #define APR_USE_SHMEM_MMAP_SHM     0
  78. #define APR_USE_SHMEM_MMAP_ZERO    1
  79. #define APR_USE_SHMEM_SHMGET_ANON  0
  80. #define APR_USE_SHMEM_SHMGET       1
  81. #define APR_USE_SHMEM_MMAP_ANON    0
  82. #define APR_USE_SHMEM_BEOS         0
  83.  
  84. #define APR_USE_FLOCK_SERIALIZE           0 
  85. #define APR_USE_SYSVSEM_SERIALIZE         0
  86. #define APR_USE_POSIXSEM_SERIALIZE        0
  87. #define APR_USE_FCNTL_SERIALIZE           0
  88. #define APR_USE_PROC_PTHREAD_SERIALIZE    1 
  89. #define APR_USE_PTHREAD_SERIALIZE         1 
  90.  
  91. #define APR_HAS_FLOCK_SERIALIZE           1
  92. #define APR_HAS_SYSVSEM_SERIALIZE         1
  93. #define APR_HAS_POSIXSEM_SERIALIZE        0
  94. #define APR_HAS_FCNTL_SERIALIZE           1
  95. #define APR_HAS_PROC_PTHREAD_SERIALIZE    1
  96. #define APR_HAS_RWLOCK_SERIALIZE          1
  97.  
  98. #define APR_PROCESS_LOCK_IS_GLOBAL        0
  99.  
  100. #define APR_HAVE_CORKABLE_TCP   0 
  101. #define APR_HAVE_GETRLIMIT      1
  102. #define APR_HAVE_IN_ADDR        1
  103. #define APR_HAVE_INET_ADDR      1
  104. #define APR_HAVE_INET_NETWORK   1
  105. #define APR_HAVE_IPV6           0
  106. #define APR_HAVE_MEMMOVE        1
  107. #define APR_HAVE_SETRLIMIT      1
  108. #define APR_HAVE_SIGACTION      1
  109. #define APR_HAVE_SIGSUSPEND     1
  110. #define APR_HAVE_SIGWAIT        1
  111. #define APR_HAVE_STRCASECMP     1
  112. #define APR_HAVE_STRDUP         1
  113. #define APR_HAVE_STRICMP        0
  114. #define APR_HAVE_STRNCASECMP    1
  115. #define APR_HAVE_STRNICMP       0
  116. #define APR_HAVE_STRSTR         1
  117. #define APR_HAVE_MEMCHR         1
  118. #define APR_HAVE_STRUCT_RLIMIT  1
  119. #define APR_HAVE_UNION_SEMUN    1
  120.  
  121. #if APR_HAVE_SYS_TYPES_H
  122. #include <sys/types.h>
  123. #endif
  124.  
  125. #if APR_HAVE_SYS_SOCKET_H
  126. #include <sys/socket.h>
  127. #endif
  128.  
  129. #if APR_HAVE_STDINT_H
  130. #include <stdint.h>
  131. #endif
  132.  
  133. /*  APR Feature Macros */
  134. #define APR_HAS_SHARED_MEMORY     1
  135. #define APR_HAS_THREADS           1
  136. #define APR_HAS_SENDFILE          0
  137. #define APR_HAS_MMAP              1
  138. #define APR_HAS_FORK              1
  139. #define APR_HAS_RANDOM            0
  140. #define APR_HAS_XLATE             1
  141. #define APR_HAS_OTHER_CHILD       1
  142. #define APR_HAS_DSO               1
  143. #define APR_HAS_SO_ACCEPTFILTER   0
  144. #define APR_HAS_UNICODE_FS        0
  145. #define APR_HAS_PROC_INVOKED      0
  146. #define APR_HAS_USER              1
  147. #define APR_HAS_LARGE_FILES       0
  148. #define APR_HAS_XTHREAD_FILES     0
  149.  
  150. /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible
  151.  * to poll on files/pipes.  On such a system, the application can
  152.  * call apr_socket_from_file() to get an APR socket representation and 
  153.  * then pass the socket representation to apr_poll_socket_add().
  154.  */
  155. #define APR_FILES_AS_SOCKETS      1
  156.  
  157. /* Not all platforms have a real INADDR_NONE.  This macro replaces INADDR_NONE
  158.  * on all platforms.
  159.  */
  160. #define APR_INADDR_NONE           INADDR_NONE
  161.  
  162. /* This macro indicates whether or not EBCDIC is the native character set.
  163.  */
  164. #define APR_CHARSET_EBCDIC        0
  165.  
  166. /* If we have a TCP implementation that can be "corked", what flag
  167.  * do we use?
  168.  */
  169. #define APR_TCP_NOPUSH_FLAG       0
  170.  
  171. /* Is the TCP_NODELAY socket option inherited from listening sockets?
  172. */
  173. #define APR_TCP_NODELAY_INHERITED 0
  174.  
  175. /* Is the O_NONBLOCK flag inherited from listening sockets?
  176. */
  177. #define APR_O_NONBLOCK_INHERITED 0
  178.  
  179. /* Typedefs that APR needs. */
  180.  
  181. typedef  unsigned char           apr_byte_t;
  182.  
  183. typedef  short           apr_int16_t;
  184. typedef  unsigned short  apr_uint16_t;
  185.                                                
  186. typedef  int             apr_int32_t;
  187. typedef  unsigned int    apr_uint32_t;
  188.                                                
  189. typedef  long long            apr_int64_t;
  190. typedef  unsigned long long   apr_uint64_t;
  191.  
  192. typedef  size_t          apr_size_t;
  193. typedef  ssize_t         apr_ssize_t;
  194. typedef  off_t           apr_off_t;
  195. typedef  int       apr_socklen_t;
  196.  
  197. /* Mechanisms to properly type numeric literals */
  198. #define APR_INT64_C(val) (val##LL)
  199.  
  200.  
  201. /* Definitions that APR programs need to work properly. */
  202.  
  203. #define APR_THREAD_FUNC
  204.  
  205. /**
  206.  * APR_DECLARE_EXPORT is defined when building the APR dynamic library,
  207.  * so that all public symbols are exported.
  208.  *
  209.  * APR_DECLARE_STATIC is defined when including the APR public headers,
  210.  * to provide static linkage when the dynamic library may be unavailable.
  211.  *
  212.  * APR_DECLARE_STATIC and APR_DECLARE_EXPORT are left undefined when
  213.  * including the APR public headers, to import and link the symbols from the 
  214.  * dynamic APR library and assure appropriate indirection and calling 
  215.  * conventions at compile time.
  216.  */
  217.  
  218. /**
  219.  * The public APR functions are declared with APR_DECLARE(), so they may
  220.  * use the most appropriate calling convention.  Public APR functions with 
  221.  * variable arguments must use APR_DECLARE_NONSTD().
  222.  *
  223.  * @deffunc APR_DECLARE(rettype) apr_func(args);
  224.  */
  225. #define APR_DECLARE(type)            type
  226.  
  227. /**
  228.  * The public APR functions using variable arguments are declared with 
  229.  * AP_DECLARE(), as they must use the C language calling convention.
  230.  *
  231.  * @deffunc APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
  232.  */
  233. #define APR_DECLARE_NONSTD(type)     type
  234.  
  235. /**
  236.  * The public APR variables are declared with AP_MODULE_DECLARE_DATA.
  237.  * This assures the appropriate indirection is invoked at compile time.
  238.  *
  239.  * @deffunc APR_DECLARE_DATA type apr_variable;
  240.  * @tip APR_DECLARE_DATA extern type apr_variable; syntax is required for
  241.  * declarations within headers to properly import the variable.
  242.  */
  243. #define APR_DECLARE_DATA
  244.  
  245. /* Define APR_SSIZE_T_FMT.  
  246.  * If ssize_t is an integer we define it to be "d",
  247.  * if ssize_t is a long int we define it to be "ld",
  248.  * if ssize_t is neither we declare an error here.
  249.  * I looked for a better way to define this here, but couldn't find one, so
  250.  * to find the logic for this definition search for "ssize_t_fmt" in
  251.  * configure.in.
  252.  */
  253. #define APR_SSIZE_T_FMT "d"
  254.  
  255. /* And APR_SIZE_T_FMT */
  256. #define APR_SIZE_T_FMT "d"
  257.  
  258. /* And APR_OFF_T_FMT */
  259. #define APR_OFF_T_FMT "qd"
  260.  
  261. /* And APR_PID_T_FMT */
  262. #define APR_PID_T_FMT "d"
  263.  
  264. /* And APR_INT64_T_FMT */
  265. #define APR_INT64_T_FMT "lld"
  266. #define APR_INT64_T_FMT_LEN 3
  267.  
  268. /* are we going to force the generic atomic operations */
  269. #define APR_FORCE_ATOMIC_GENERIC 0
  270.  
  271. /* Does the proc mutex lock threads too */
  272. #define APR_PROC_MUTEX_IS_GLOBAL      0
  273.  
  274. /* Local machine definition for console and log output. */
  275. #define APR_EOL_STR              "\n"
  276.  
  277. #if APR_HAVE_SYS_WAIT_H
  278.  
  279. /* We have a POSIX wait interface */
  280. #include <sys/wait.h>
  281.  
  282. #ifdef WEXITSTATUS
  283. #define apr_wait_t       int
  284. #else
  285. #define apr_wait_t       union wait
  286. #define WEXITSTATUS(status)    (int)((status).w_retcode)
  287. #define WTERMSIG(status)       (int)((status).w_termsig)
  288. #endif /* !WEXITSTATUS */
  289. #endif /* HAVE_SYS_WAIT_H */
  290.  
  291. #ifdef OS2
  292. #define INCL_DOS
  293. #define INCL_DOSERRORS
  294. #include <os2.h>
  295. #endif
  296.  
  297. /* header files for PATH_MAX, _POSIX_PATH_MAX */
  298. #if APR_HAVE_SYS_SYSLIMITS_H
  299. #include <sys/syslimits.h>
  300. #endif
  301. #if APR_HAVE_LIMITS_H
  302. #include <limits.h>
  303. #endif
  304.  
  305. #if defined(PATH_MAX)
  306. #define APR_PATH_MAX       PATH_MAX
  307. #elif defined(_POSIX_PATH_MAX)
  308. #define APR_PATH_MAX       _POSIX_PATH_MAX
  309. #else
  310. #error no decision has been made on APR_PATH_MAX for your platform
  311. #endif
  312. /** @} */
  313. #endif /* APR_H */
  314.